#ifndef sprite_game_enemy_h
#define sprite_game_enemy_h

#import "head.h"

@class sprite_game_enemy_life_bar;
@class sprite_game_weak_point;
@class sprite_game_enemy_tail;
@class sprite_game_enemy_skull;
@class sprite_game_enemy_eye;
@class sprite_game_enemy_mask;
@class sprite_game_heart;
@class sprite_game_bomb;

/*sprite_game_enemy
*/
@interface sprite_game_enemy : CCSprite
{

	CGPoint boss3BornPoint_;


	/*box2d
	*/
	b2Body *box2dBody_;
	b2Fixture *fixtureBody_;
	b2Fixture *fixtureArmor_;

	b2Fixture *fixtureBoss1Head_;
	b2Fixture *fixtureBoss1Body_;

	b2Fixture *fixtureBoss3Head_;
	b2Fixture *fixtureBoss3Body_;
	b2Fixture *fixtureBoss3Ass_;

	CCSprite *effectCover_;
	CCSprite *effectMouth_;
	CCSprite *effectMosquito_;
	sprite_game_enemy_tail *tailLeft_;
	sprite_game_enemy_tail *tailRight_;
	std::list<sprite_game_enemy_skull *> skullList_;
	sprite_game_enemy_mask *mask_;
	sprite_game_enemy_eye *eye_[BOSS_3_QTE_EYE_COUNT];
	CCParticleSystem *boss3ChargeParticle_;


	/*flag
	*/
	int touchState_;
	bool flagTimeStopValid_;
	int flagBoss1Stage_;
	int flagBoss2Stage_;
	int flagBoss3Stage_;
	int flagBoss1StrongAttackTotalDropBombCount_;
	int flagBoss1StrongAttackDropBombCount_;
	float flagBoss1StrongAttackDropBombOffset_;
	int flagBoss3SpecialAttackEyeOpenIndex_;
	bool flagBoss3SpecialQte_;

	/*handle
	*/
	std::list<sprite_game_bomb *> boss1StrongAttackBombTable_;
	sprite_game_enemy *boss3Handle_;
	sprite_game_enemy *boss3SlaveLeftHandle_;
	sprite_game_enemy *boss3SlaveRightHandle_;
}

@property (nonatomic, readwrite) int type;
@property (nonatomic, readwrite) int state;
@property (nonatomic, readwrite) int lifePoint;
@property (nonatomic, readwrite) b2Body *box2dBody;
@property (nonatomic, readwrite) b2Fixture *fixtureBody;
@property (nonatomic, readwrite) b2Fixture *fixtureArmor;
@property (nonatomic, readwrite, assign) CCSprite *image;
@property (nonatomic, readwrite, assign) CCSprite *effectShockWave;
@property (nonatomic, readwrite, assign) CCSprite *effectCover;
@property (nonatomic, readwrite, assign) sprite_game_enemy_life_bar *lifeBar;
@property (nonatomic, readwrite) int flagBoss2Stage;
@property (nonatomic, readwrite, assign) sprite_game_heart *mouthHeartHandle;
@property (nonatomic, readwrite, assign) sprite_game_heart *mosquitoHeartHandle;
@property (nonatomic, readwrite, assign) sprite_game_enemy *boss3Handle;
@property (nonatomic, readwrite, assign) sprite_game_enemy *boss3SlaveLeftHandle;
@property (nonatomic, readwrite, assign) sprite_game_enemy *boss3SlaveRightHandle;

- (id)initSpriteGameEnemy:(SMissionEnemy *)InfoData;
- (void)dealloc;
- (void)tick:(ccTime)Time;
- (void)draw;

/*box2d control
*/
- (void)CreateBody;
- (void)DestroyBody;
- (b2Vec2)ComputeBodyPosition;

/*boss2
*/

/*game state control
*/
- (void)Pause;
- (void)Resume;

/*event
*/
- (void)EventTouchBegin:(CGPoint)Point;
- (void)EventTouchMove:(CGPoint)Point;
- (void)EventTouchEnd:(CGPoint)Point;

/*when check collision, return if is enemy fixture
*/
- (bool)IsBodyFixture:(b2Fixture *)Fixture;
- (bool)IsArmorFixture:(b2Fixture *)Fixture;

- (bool)IsBoss1HeadFixture:(b2Fixture *)Fixture;
- (bool)IsBoss1BodyFixture:(b2Fixture *)Fixture;
- (bool)IsBoss1TailFixture:(b2Fixture *)Fixture;

- (bool)IsBoss2SkullFixture:(b2Fixture *)Fixture;

- (bool)IsBoss3HeadFixture:(b2Fixture *)Fixture;
- (bool)IsBoss3BodyFixture:(b2Fixture *)Fixture;
- (bool)IsBoss3AssFixture:(b2Fixture *)Fixture;

/*check enemy state invincible
*/
- (bool)IsInvincible;

/*Damage, return : true - dead
* DamageBoss2Skull, return : true - hit the weap point skull
*/
- (bool)DamageBoss1Tail:(float)DamagePoint And:(b2Fixture *)Fixture;
- (bool)DamageBoss2Skull:(float)DamagePoint And:(b2Fixture *)Fixture;

/*item function
*/

/*ai
*/

/*action
*/






/*get random move speed
*/

/*find the nearest none flag active heart
*/

/*timer
*/

/*play animation
*/


/*call back
*/








@end

/*sprite_game_enemy_mask
*/
@interface sprite_game_enemy_mask : CCSprite
{
	float r_;
	float g_;
	float b_;
	bool flagFadeOut_;
	CCSprite *image_;
}

@property (nonatomic, readwrite) float r;
@property (nonatomic, readwrite) float g;
@property (nonatomic, readwrite) float b;
@property (nonatomic, readwrite) bool flagFadeOut;

- (id)initSpriteGameEnemyMask;
- (void)draw;
- (void)actionReady;
- (void)ActionFadeOut;
- (void)CallBackActionFadeOutOver:(id)Sender;

@end

/*sprite_game_enemy_eye
*/
@interface sprite_game_enemy_eye : CCSprite
{
	CCSprite *image_;
	bool flagEyeClose_;
}

@property (nonatomic, readwrite) bool flagEyeClose;

- (id)initSpriteGameEnemyEye;

/*game state control
*/
- (void)Pause;
- (void)Resume;

- (void)ActionEyeOpen;
- (void)ActionEyeClose;

- (void)CallBackActionEyeOpenOver:(id)Sender;
- (void)CallBackActionEyeCloseOver:(id)Sender;

@end

#endif